/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
function insertar() {

    imgI = document.getElementById('I');
    imgI.style.top = '200px';
    imgI.style.left = '400px';

    imgN = document.getElementById("N");
    imgN.style.top = '50px';
    imgN.style.left = '50px';

    imgS = document.getElementById('S');
    imgS.style.top = '500px';
    imgS.style.left = '100px';

    imgE = document.getElementById("E");
    imgE.style.top = '100px';
    imgE.style.left = '300px';

    imgR = document.getElementById('R');
    imgR.style.top = '50px';
    imgR.style.left = '-250px';

    imgT = document.getElementById('T');
    imgT.style.top = '50px';
    imgT.style.left = '50px';

    imgA = document.getElementById('A');
    imgA.style.top = '100px';
    imgA.style.left = '200px';

    setTimeout(moverInsertar, 1000);

}

function actualizar() {

    imgA = document.getElementById('A');
    imgA.style.top = '100px';
    imgA.style.left = '200px';

    imgC = document.getElementById('C');
    imgC.style.top = '400px';
    imgC.style.left = '100px';

    imgT = document.getElementById('T');
    imgT.style.top = '50px';
    imgT.style.left = '50px';

    imgU = document.getElementById("U");
    imgU.style.top = '100px';
    imgU.style.left = '200px';

    imgL = document.getElementById('L');
    imgL.style.top = '-50px';
    imgL.style.left = '-200px';

    imgI = document.getElementById('I');
    imgI.style.top = '200px';
    imgI.style.left = '400px';

    imgR = document.getElementById('R');
    imgR.style.top = '50px';
    imgR.style.left = '-250px';

    imgZ = document.getElementById("Z");
    imgZ.style.top = '100px';
    imgZ.style.left = '200px';

    setTimeout(moverActualizar, 1000);
}



function menu() {

    imgM = document.getElementById("M");
    imgM.style.top = '400px';
    imgM.style.left = '400px';


    imgE = document.getElementById("E");
    imgE.style.top = '100px';
    imgE.style.left = '300px';


    imgN = document.getElementById("N");
    imgN.style.top = '50px';
    imgN.style.left = '50px';

    imgU = document.getElementById("U");
    imgU.style.top = '100px';
    imgU.style.left = '200px';

    /*imgP = document.getElementById('P');
     imgP.style.top = '500px';
     imgP.style.left = '100px';*/


    /*  imgO = document.getElementById("O");
     imgO.style.top = '100px';
     imgO.style.left = '300px';*/

    /*
     
     
     
     
     
     */
    /*
     imgC = document.getElementById('C');
     imgC.style.top = '400px';
     imgC.style.left = '100px';
     
     
     
     
     */



    setTimeout(moverMenu, 1000);

}

function moverInsertar() {
    moverI();
    moverN();
    moverS();
    moverE();
    moverR();
    moverT();
    moverA();
}

function moverActualizar() {
    moverA();
    moverC();
    moverT();
    moverU();
    moverL();
    moverI();
    moverZ();
    moverR();

}

function moverMenu() {
    moverM();
    moverE();
    moverN();
    moverU();

}
function moverZ() {
    imgZ.style.top = parseInt(imgZ.style.top) - 4 + 'px';
    imgZ.style.left = parseInt(imgZ.style.left) - 8 + 'px';
    animate = setTimeout(moverZ, 45); // call moveRight in 20msec
    stop(imgZ, '0px');
}

function moverA() {
    imgA.style.top = parseInt(imgA.style.top) - 4 + 'px';
    imgA.style.left = parseInt(imgA.style.left) - 8 + 'px';
    animate = setTimeout(moverA, 45); // call moveRight in 20msec
    stop(imgA, '0px');
}

function moverC() {
    imgC.style.top = parseInt(imgC.style.top) - 40 + 'px';
    imgC.style.left = parseInt(imgC.style.left) - 10 + 'px';
    animate = setTimeout(moverC, 40); // call moveRight in 20msec
    stop(imgC, '0px');
}


function moverT() {
    imgT.style.top = parseInt(imgT.style.top) - 2 + 'px';
    imgT.style.left = parseInt(imgT.style.left) - 2 + 'px';
    animate = setTimeout(moverT, 45); // call moveRight in 20msec
    stop(imgT, '0px');
}

function moverI() {
    imgI.style.top = parseInt(imgI.style.top) - 5 + 'px';
    imgI.style.left = parseInt(imgI.style.left) - 10 + 'px';
    animate = setTimeout(moverI, 45); // call moveRight in 20msec
    stop(imgI, '0px');
}

function moverL() {
    imgL.style.top = parseInt(imgL.style.top) + 5 + 'px';
    imgL.style.left = parseInt(imgL.style.left) + 20 + 'px';
    animate = setTimeout(moverL, 55); // call moveRight in 20msec
    stop(imgL, '0px');
}

function moverS() {
    imgS.style.top = parseInt(imgS.style.top) - 10 + 'px';
    imgS.style.left = parseInt(imgS.style.left) - 2 + 'px';
    animate = setTimeout(moverS, 45); // call moveRight in 20msec
    stop(imgS, '0px');
}

function moverP() {
    imgP.style.top = parseInt(imgP.style.top) - 50 + 'px';
    imgP.style.left = parseInt(imgP.style.left) - 10 + 'px';
    animate = setTimeout(moverP, 40); // call moveRight in 20msec
    stop(imgP, '0px');
}

function moverR() {
    imgR.style.top = parseInt(imgR.style.top) - 10 + 'px';
    imgR.style.left = parseInt(imgR.style.left) + 50 + 'px';
    animate = setTimeout(moverR, 55); // call moveRight in 20msec
    stop(imgR, '0px');
}

function moverM() {
    imgM.style.top = parseInt(imgM.style.top) - 10 + 'px';
    imgM.style.left = parseInt(imgM.style.left) - 10 + 'px';
    animate = setTimeout(moverM, 45); // call moveRight in 20msec
    stop(imgM, '0px');
}

function moverE() {
    imgE.style.top = parseInt(imgE.style.top) - 5 + 'px';
    imgE.style.left = parseInt(imgE.style.left) - 15 + 'px';
    animate = setTimeout(moverE, 55); // call moveRight in 20msec
    stop(imgE, '0px');
}

function moverN() {
    imgN.style.top = parseInt(imgN.style.top) - 2 + 'px';
    imgN.style.left = parseInt(imgN.style.left) - 2 + 'px';
    animate = setTimeout(moverN, 45); // call moveRight in 20msec
    stop(imgN, '0px');
}

function moverU() {
    imgU.style.top = parseInt(imgU.style.top) - 4 + 'px';
    imgU.style.left = parseInt(imgU.style.left) - 8 + 'px';
    animate = setTimeout(moverU, 45); // call moveRight in 20msec
    stop(imgU, '0px');

}

function stop(nombre, posicion) {
    if (nombre.style.top === posicion) {
        clearTimeout(animate);
    }
}



function raton(nombre) {

    if (nombre.style.top === '0px') {
        nombre.style.top = '40px';
        nombre.style.left = '10px';
    }


}

function Paro(nombre) {

    if (nombre.style.top === '40px') {
        nombre.style.top = '0px';
        nombre.style.left = '0px';
    }
}